Skip to content

[WBT] enable coreCLR#124850

Draft
pavelsavara wants to merge 20 commits intodotnet:mainfrom
pavelsavara:wbt_coreclr
Draft

[WBT] enable coreCLR#124850
pavelsavara wants to merge 20 commits intodotnet:mainfrom
pavelsavara:wbt_coreclr

Conversation

@pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Feb 25, 2026

  • drop WasmBrowserRunMainOnly
  • add [TestCategory("native")] as necessary
  • always expect dotnet.diagnostics.js on CoreCLR
  • disable native trait for CoreCLR run
  • split off AOT tests

Passing: 59 Failing: 27

@pavelsavara pavelsavara added this to the 11.0.0 milestone Feb 25, 2026
@pavelsavara pavelsavara self-assigned this Feb 25, 2026
Copilot AI review requested due to automatic review settings February 25, 2026 09:27
@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-Infrastructure-coreclr os-browser Browser variant of arch-wasm labels Feb 25, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request enables CoreCLR runtime testing in the WASM Build Tests suite by categorizing tests and filtering them appropriately based on the runtime flavor. The PR removes a CoreCLR-specific test asset that is no longer needed and ensures that tests requiring native builds, Mono-specific features, or workload installations are properly excluded when running with CoreCLR.

Changes:

  • Removed the WasmBrowserRunMainOnly test asset and test class, which was specifically created for CoreCLR but is no longer needed
  • Added TestCategory attributes to categorize tests as "native" (requiring AOT/native builds), "mono" (Mono-specific features), or "workload" (requiring workload installation)
  • Updated test filtering logic in Wasm.Build.Tests.csproj to exclude native/mono/workload tests when running with CoreCLR runtime
  • Modified WasmSdkBasedProjectProvider to expect diagnostics files for CoreCLR builds

Reviewed changes

Copilot reviewed 46 out of 46 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/mono/wasm/testassets/WasmBrowserRunMainOnly/* Deleted entire test asset directory (6 files) that was specific to CoreCLR testing
src/mono/wasm/Wasm.Build.Tests/WasmBrowserRunMainOnly.cs Deleted CoreCLR-specific test class
src/mono/wasm/Wasm.Build.Tests/BrowserStructures/TestAsset.cs Removed WasmBrowserRunMainOnly test asset reference
src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj Updated XUnit trait filtering to exclude native/mono/workload categories for CoreCLR
src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs Added logic to expect diagnostics.js files for CoreCLR builds
src/mono/wasm/Wasm.Build.Tests/WorkloadTests.cs Added "native" category to class-level TestCategory
src/mono/wasm/Wasm.Build.Tests/WasmBuildAppTest.cs Added "native" category to AOT test methods
src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs Added "native" category to PublishSIMD_AOT test
src/mono/wasm/Wasm.Build.Tests/WasmNativeDefaultsTests.cs Added "native" category to class-level TestCategory
src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs Added "workload" and "native" categories to various template tests
src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs Added "native" category to class-level TestCategory
src/mono/wasm/Wasm.Build.Tests/SatelliteAssembliesTests.cs Added "native" category to resource assembly tests
src/mono/wasm/Wasm.Build.Tests/PInvokeTableGeneratorTests.cs Added "native" category to class-level TestCategory
src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/* Added "native" category to all native rebuild test classes (5 files)
src/mono/wasm/Wasm.Build.Tests/NativeLibraryTests.cs Added "native" category to class-level TestCategory
src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs Added "native" category to class-level TestCategory
src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs Split SymbolMapFileEmitted test into two separate tests, marking only the emitting case as "native"
src/mono/wasm/Wasm.Build.Tests/MemoryTests.cs Added "native" category to class-level TestCategory
src/mono/wasm/Wasm.Build.Tests/MainWithArgsTests.cs Added "native" category to main-with-args tests
src/mono/wasm/Wasm.Build.Tests/InvariantTimezoneTests.cs Added "native" category to invariant timezone tests
src/mono/wasm/Wasm.Build.Tests/InvariantGlobalizationTests.cs Added "native" category to invariant globalization tests
src/mono/wasm/Wasm.Build.Tests/InterpPgoTests.cs Added "mono" category to class-level TestCategory
src/mono/wasm/Wasm.Build.Tests/IcuTests.cs Added "native" and "workload" categories to ICU tests
src/mono/wasm/Wasm.Build.Tests/IcuShardingTests*.cs Added "native" category to ICU sharding tests (2 files)
src/mono/wasm/Wasm.Build.Tests/DllImportTests.cs Added "native" category to class-level TestCategory
src/mono/wasm/Wasm.Build.Tests/DiagnosticsTests.cs Added "mono" category to class-level TestCategory
src/mono/wasm/Wasm.Build.Tests/BuildPublishTests.cs Added "native" category to AOT publish tests
src/mono/wasm/Wasm.Build.Tests/Blazor/* Added "native" and "mono" categories to various Blazor tests (8 files)

Copilot AI review requested due to automatic review settings February 25, 2026 10:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 49 out of 49 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings February 25, 2026 16:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 50 out of 50 changed files in this pull request and generated no new comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 51 out of 51 changed files in this pull request and generated 1 comment.

@pavelsavara
Copy link
Member Author

we can update this branch and try to add back the lazy loading, I just merged it

Copilot AI review requested due to automatic review settings February 26, 2026 07:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 50 out of 50 changed files in this pull request and generated 1 comment.

Comment on lines +59 to 62
<HelixWorkItem Include="@(BuildWasmApps_PerJobList->'$(WorkItemPrefix)%(Identity)')" Condition="'$(RuntimeFlavor)' == 'CoreCLR' and '$(WasmFingerprintAssets)' == 'true' and '$(WasmBundlerFriendlyBootConfig)' == 'false'">
<PayloadArchive>$(_BuildWasmAppsPayloadArchive)</PayloadArchive>
<PreCommands>$(EnvVarCommand) &quot;HELIX_XUNIT_ARGS=-class %(Identity)&quot;</PreCommands>
<Command>$(HelixCommand)</Command>
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new per-class CoreCLR work item condition relies on $(WasmFingerprintAssets) == 'true', but in CoreCLR BuildWasmApps this property may be empty (not explicitly set) even though fingerprinting defaults to enabled in the SDK/RunScriptTemplate. That would prevent these per-class items from being created, making BuildWasmAppsJobsListCLR.txt unused. Also, if WasmFingerprintAssets is set to true for CoreCLR in the future, ensure the existing fallback Wasm.Build.Tests work item (below) is suppressed to avoid running both the per-class items and the full suite.

Copilot uses AI. Check for mistakes.
@ilonatommy
Copy link
Member

ilonatommy commented Feb 26, 2026

Summary:

Test Class Result Error Text Comments Issue
AppSettingsTests 0/8 '/appsettings.json' exists 'False' CoreCLR doesn't bundle appsettings files #124895
DebugLevelTests 14/14
DownloadThenInitTests 0/2 CoreCLR can't re-init native module #124896
EnvVariablesTests 1/1
FilesToIncludeInFileSystemTests 2/2
HttpTests 2/2
LazyLoadingTests 1/4 The lazy loading test didn't load PDB CoreCLR WASM does not load PDBs for lazy-loaded assemblies; runtime pack needs update to support this. #124898
LibraryInitializerTests 0/2 LoadLibraryInitializer: empty collection (initializer not called); AbortStartupOnError: WASM EXIT timeout EnableDiagnostics=true does not fix it #124899
MaxParallelDownloadsTests 0/2 Active downloads exceeded the limit (2 > 1, 5 > 4) Download throttling logic not enforced #124900
ModuleConfigTests 4/8 DownloadProgressFinishes: WASM EXIT timeout; OutErrOverrideWorks: override failed; OverrideBootConfigName: not supported
PreloadingTests 8/8
RebuildTests 1/1
SatelliteLoadingTests 2/4 Assert.Equal() Failure: Strings differ (expected: "es-ES with satellite: hola", actual: "es-ES with satellite: hello") Satellite resource loading returns wrong string for es-ES; CoreCLR does not load correct satellite resources #124901
WasmBuildAppTest 8/8
WasmRunOutOfAppBundleTests 2/2
WasmTemplateTests 1/1

Copilot AI review requested due to automatic review settings February 26, 2026 14:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 53 out of 53 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

src/libraries/sendtohelix-wasm.targets:70

  • For RuntimeFlavor=CoreCLR the per-class HelixWorkItem is created even when TestUsingWorkloads=false, but the aggregate Wasm.Build.Tests work item is also created because its condition includes $(TestUsingWorkloads) != 'true'. This will schedule the same tests twice in CoreCLR BuildWasmApps jobs. Update the conditions so CoreCLR runs either the per-class work items or the aggregate work item, but not both (e.g., gate the CoreCLR per-class items on TestUsingWorkloads=='true', or exclude RuntimeFlavor=CoreCLR from the aggregate condition when per-class splitting is enabled).
      <HelixWorkItem Include="@(BuildWasmApps_PerJobList->'$(WorkItemPrefix)%(Identity)')" Condition="'$(RuntimeFlavor)' == 'CoreCLR' and '$(WasmFingerprintAssets)' == 'true' and '$(WasmBundlerFriendlyBootConfig)' == 'false'">
        <PayloadArchive>$(_BuildWasmAppsPayloadArchive)</PayloadArchive>
        <PreCommands>$(EnvVarCommand) &quot;HELIX_XUNIT_ARGS=-class %(Identity)&quot;</PreCommands>
        <Command>$(HelixCommand)</Command>
        <Timeout>$(_workItemTimeout)</Timeout>
      </HelixWorkItem>

      <HelixWorkItem Include="$(WorkItemPrefix)Wasm.Build.Tests" Condition="'$(TestUsingWorkloads)' != 'true' or '$(WasmFingerprintAssets)' != 'true' or '$(WasmBundlerFriendlyBootConfig)' != 'false'">
        <PayloadArchive>$(_BuildWasmAppsPayloadArchive)</PayloadArchive>
        <Command>$(HelixCommand)</Command>
        <Timeout>$(_workItemTimeout)</Timeout>
      </HelixWorkItem>

Comment on lines 248 to 251
case "DotnetRun":
case "MainWithArgs":
dotnet.run();
dotnet.runMainAndExit();
break;
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotnet.runMainAndExit() is invoked without await. Other call sites in this repo await runMainAndExit (it returns a Promise), and not awaiting here can let the script fall through without proper error/exit propagation for these scenarios. Please await the call (and ensure the switch case exits afterward if needed).

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings February 26, 2026 19:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 56 out of 56 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/libraries/sendtohelix-wasm.targets:64

  • The CoreCLR work item condition on line 59 does not check for TestUsingWorkloads like the Mono condition on line 52 does. This means CoreCLR tests will run even when TestUsingWorkloads is 'false', while Mono tests require workloads. Is this intentional? If CoreCLR WASM requires workloads to function, the condition should include the same '$(TestUsingWorkloads)' == 'true' check. Otherwise, the test could fail in non-workload scenarios for CoreCLR.
      <HelixWorkItem Include="@(BuildWasmApps_PerJobList->'$(WorkItemPrefix)%(Identity)')" Condition="'$(RuntimeFlavor)' == 'CoreCLR' and '$(WasmFingerprintAssets)' == 'true' and '$(WasmBundlerFriendlyBootConfig)' == 'false'">
        <PayloadArchive>$(_BuildWasmAppsPayloadArchive)</PayloadArchive>
        <PreCommands>$(EnvVarCommand) &quot;HELIX_XUNIT_ARGS=-class %(Identity)&quot;</PreCommands>
        <Command>$(HelixCommand)</Command>
        <Timeout>$(_workItemTimeout)</Timeout>
      </HelixWorkItem>

Copilot AI review requested due to automatic review settings February 26, 2026 20:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 56 out of 56 changed files in this pull request and generated 1 comment.

<PropertyGroup Condition="'$(Scenario)' == 'BuildWasmApps'">
<BuildWasmAppsJobsList>$(RepositoryEngineeringDir)testing\scenarios\BuildWasmAppsJobsList.txt</BuildWasmAppsJobsList>
<BuildWasmAppsJobsList Condition="'$(RuntimeFlavor)' == 'Mono'">$(RepositoryEngineeringDir)testing\scenarios\BuildWasmAppsJobsList.txt</BuildWasmAppsJobsList>
<BuildWasmAppsJobsList Condition="'$(RuntimeFlavor)' == 'CoreCLR'">$(RepositoryEngineeringDir)testing\scenarios\BuildWasmAppsJobsListCLR.txt</BuildWasmAppsJobsList>
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BuildWasmAppsJobsList for CoreCLR points to BuildWasmAppsJobsListCLR.txt, but the repo contains eng/testing/scenarios/BuildWasmAppsJobsListCoreCLR.txt (and no ...CLR.txt). With the current path, ReadLinesFromFile in sendtohelix-wasm.targets will never run and CoreCLR BuildWasmApps work items won’t get split per test class. Update the filename here to match the added jobs list file.

Suggested change
<BuildWasmAppsJobsList Condition="'$(RuntimeFlavor)' == 'CoreCLR'">$(RepositoryEngineeringDir)testing\scenarios\BuildWasmAppsJobsListCLR.txt</BuildWasmAppsJobsList>
<BuildWasmAppsJobsList Condition="'$(RuntimeFlavor)' == 'CoreCLR'">$(RepositoryEngineeringDir)testing\scenarios\BuildWasmAppsJobsListCoreCLR.txt</BuildWasmAppsJobsList>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-Infrastructure-coreclr os-browser Browser variant of arch-wasm

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants